#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>

int main()
{
pid_t ret=fork();

int t=100;

if(ret==0)
{
int c=5;
 while(1)
{
sleep(1);
printf("imchild :%d  myfather %d t=%d\n ",getpid(),getppid(),t);
if(c--)
{
if(c==0)t=999;
}

}} 
else
{
while(1)
{
sleep(1);
printf("imfather :%d    mychild %d  t=%d\n",getpid(),getppid(),t);
}
}
return 0;
}

